<form action="${ctx}/platrole/authorization" method="post" enctype="multipart/form-data" id="authorizationForm">
	<input type="hidden" name="roleId" value="${roleId!}" />
	<!--<div id="menuBox0">
	<#list firstLevelMenuList as menu>
		<div class="form-group form-inline row">
			<div class="col-sm-12" id="menuBox${menu.menuId}">
				<label ondblclick ="checkAll(${menu.menuId})">${menu.menuName}：</label>
				<#if (secondLevelMenuMap["${menu.menuId}"]??) && (secondLevelMenuMap["${menu.menuId}"]?size>0)>
					<#list secondLevelMenuMap["${menu.menuId!}"] as childMenu>
						<#if authorityMenuIdSet?seq_contains(childMenu.menuId)>
							<label><input type="checkbox" class="minimal"  name="menuId" value="${childMenu.menuId}" checked>&nbsp;&nbsp;${childMenu.menuName}</label>
						<#else>
							<label><input type="checkbox" class="minimal" id="menuId${menu.menuId}" name="menuId" value="${childMenu.menuId}">&nbsp;&nbsp;${childMenu.menuName}</label>
						</#if>
					</#list>
				</#if>
			</div>
		</div>
	</#list>
</div>-->
	<table>
		<tr align="conter">
			<th width="20%">一级菜单</th>
			<th width="20%">二级菜单</th>
			<th width="60%">三级菜单</th>
		</tr>
		<#list firstLevelMenuList as menu>
		<tr>
			<#if secondLevelMenuMap["${menu.menuId}"]?? && (secondLevelMenuMap["${menu.menuId}"]?size>0)>
			<#assign secondLevelMenuList=secondLevelMenuMap["${menu.menuId}"]/>
			<td rowspan="${secondLevelMenuList?size +1}">
				<#if authorityMenuIdSet?seq_contains(menu.menuId)>
				<input type="checkbox" class="minimal" name="menuId" value="${menu.menuId}" checked>&nbsp;&nbsp;${menu.menuName}
				<#else>
				<input type="checkbox" class="minimal" name="menuId" value="${menu.menuId}">&nbsp;&nbsp;${menu.menuName}
			</#if></td>
			<#else>
			<td><#if authorityMenuIdSet?seq_contains(menu.menuId)>
				<input type="checkbox" class="minimal" name="menuId" value="${menu.menuId}" checked>&nbsp;&nbsp;${menu.menuName}
				<#else>
				<input type="checkbox" class="minimal" name="menuId" value="${menu.menuId}">&nbsp;&nbsp;${menu.menuName}
			</#if></td>
			<td></td>
			<td></td>
		</#if>
		</tr>
		<#if secondLevelMenuMap["${menu.menuId}"]?? && (secondLevelMenuMap["${menu.menuId}"]?size>0)>
		<#list secondLevelMenuMap["${menu.menuId}"] as secondMenu>
		<tr>
			<td><#if authorityMenuIdSet?seq_contains(secondMenu.menuId)>
				<input type="checkbox" class="minimal" p="${menu.menuId}" name="menuId" value="${secondMenu.menuId}" checked>&nbsp;&nbsp;${secondMenu.menuName}
				<#else>
				<input type="checkbox" class="minimal" p="${menu.menuId}" name="menuId" value="${secondMenu.menuId}">&nbsp;&nbsp;${secondMenu.menuName}
			</#if></td>
			<td>
				<#if (thirdLevelMenuMap["${secondMenu.menuId}"]??) && (thirdLevelMenuMap["${secondMenu.menuId}"]?size>0)>
				<#list thirdLevelMenuMap["${secondMenu.menuId}"] as thirdMenu>
				<#if authorityMenuIdSet?seq_contains(thirdMenu.menuId)>
				<input type="checkbox" class="minimal" p="${menu.menuId},${secondMenu.menuId}" name="menuId" value="${thirdMenu.menuId}" checked>&nbsp;&nbsp;${thirdMenu.menuName}
				<#else>
				<input type="checkbox" class="minimal" p="${menu.menuId},${secondMenu.menuId}" name="menuId" value="${thirdMenu.menuId}">&nbsp;&nbsp;${thirdMenu.menuName}
			</#if>
		</#list>
	</#if>
	</td>
	</tr>
</#list>
</#if>
</#list>
</table>
</form>
<script>
  $(function () {
	  $('input[type="checkbox"].minimal').iCheck({
	      checkboxClass: 'icheckbox_minimal-blue'
      });
  })
  function checkAll(menuId) {
      var checkAll=$("#menuBox"+menuId+" :checked").length;
      var defaultAll=$("#menuBox"+menuId+" :checkbox").length;
      if(checkAll==defaultAll){
          $("#menuBox"+menuId+" :checkbox").prop("checked", false);
	  }else{
          $("#menuBox"+menuId+" :checkbox").prop("checked", true);
	  }
  }
</script>
<style>
	table tr th, table tr td { border:1px solid #b9cdff;padding-left:20px;padding-right:20px;}
	table { width: 100%; min-height: 25px; line-height: 25px; padding:0px 17px;}
</style>